package com.eventx.service.def;

import com.eventx.bus.event.EventSubscriber;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;

/**
 * @author: anrror
 **/
public class DefaultEventSubscriber extends EventSubscriber {

    DefaultEventSource defaultEventSource ;

    private boolean running = false;

    public DefaultEventSubscriber(DefaultEventSource defaultEventSource) {
        super();
        this.defaultEventSource = defaultEventSource;
    }

    @Override
    public void start() {
        defaultEventSource.addDefaultEventListenner(new DefaultEventListenner(this));
    }

    @Override
    public void stop() {
        this.running = false;
    }
}
